<?php

namespace App\Http\Requests\Admin\ExpressCompany;

use Illuminate\Foundation\Http\FormRequest;

class ExpressCompanyCreate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 定义表单规则
     *
     * Date: 13/04/2018
     * @author Tenny
     * @return array
     */
    public function rules()
    {
        return [
            'express_name' => 'required',
            'express_no' => 'required',
            'code_name' => 'required',
            'status' => 'nullable',
            'phone' => 'required',
            'express_logo' => 'nullable',
            'region_mark' => 'nullable',
        ];
    }

    /**
     * 定义错误响应消息
     *
     * Date: 13/04/2018
     * @author Tenny
     * @return array
     */
    public function messages()
    {
        return [
            'express_name.required' => '请输入快递公司名称',
            'express_no.required' => '请输入物流编号',
            'code_name' => '请输入物流名称',
            'phone' => '请输入联系电话',
        ];
    }
}
